package com.ax.center.service.impl;

import com.ax.center.dto.ApiResponse;
import com.ax.center.entity.Operation;
import com.ax.center.mapper.OperationMapper;
import com.ax.center.service.OperationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zy
 * @date 2023/7/13 10:47
 */
@Service
public class OperationServiceImpl extends ServiceImpl<OperationMapper, Operation> implements OperationService {

    @Autowired
    private OperationMapper operationMapper;
    @Override
    public ApiResponse insert(Operation operation) {
        save(operation);
        return ApiResponse.ok();
    }

    @Override
    public ApiResponse queryAll() {
        List<Operation> operations = operationMapper.selectList(null);
        return ApiResponse.ok(operations);
    }
}
